package org.example.base;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseResult<T>{
    private int code;
    private String errorMsg;
    private T data;

    public static <T> BaseResult<T> buildSucc(T data) {
        BaseResult<T> r = new BaseResult();
        r.setCode(0);
        r.setErrorMsg((String)null);
        r.setData(data);
        return r;
    }

}
